#include <stdio.h>
#include <unistd.h>
int num = 0;
int main(int argc, char*argv[]){
    pid_t pid;
    pid = fork();
    if(pid == 0){       /*child*/
        num = 1;
        printf("child_num is %d\n", num);   
	printf("Child pid is %d\n",getpid());
    }else if(pid > 0){  /*parent*/
        num = 2;
        printf("parent_num=%d\n", num);
	printf("Parent pid is %d\n",getpid());
    }
}

